package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.pojo.AdminOder;
import com.itheima.pojo.Order;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface UserOrderMapper {
    void updateUserOrder(Order userOrder);

    Order getById(Integer id);

    Page<Order> page(Order query);

    @Delete("delete from user_order where id=#{id}")
    void deleteById(Integer id);

    @Insert("insert into user_order(id, trading_order_no, status, amount, member_id, phone, pet_id, branch_id, image, get_pet_time, create_time, update_time, create_by, update_by) VALUES(#{id}," +
            "#{tradingOrderNo},#{status},#{amount},#{memberId},#{phone},#{petId},#{branchId},#{image},#{getPetTime},#{createTime},#{updateTime},#{createBy},#{updateBy}) ")
    void add(Order order);
}
